/**
* Copyright (C) 2008 Happy Fish / YuQing
*
* FastDFS may be copied only under the terms of the GNU General
* Public License V3, which may be found in the FastDFS source kit.
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
**/

#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "global.h"

int g_network_timeout = DEFAULT_NETWORK_TIMEOUT;
char g_base_path[MAX_PATH_SIZE];
Version g_version = {1, 0};

bool g_continue_flag = true;

int g_server_mode = FNIO_SERVER_MODE_CLIENT;
//int g_server_mode = FNIO_SERVER_MODE_SERVER;
int g_proxy_client_port = FNIO_PROXY_CLIENT_DEFAULT_PORT;
int g_proxy_server_port = FNIO_PROXY_SERVER_DEFAULT_PORT;
int g_max_connections = DEFAULT_MAX_CONNECTONS;
int g_min_buff_size = FNIO_MIN_BUFF_SIZE;
int g_max_buff_size = FNIO_MAX_BUFF_SIZE;
int g_max_pkg_size = FNIO_MAX_PKG_SIZE;
int g_server_work_threads = FNIO_DEFAULT_SERVER_WORK_THREADS;

int g_sync_log_buff_interval = SYNC_LOG_BUFF_DEF_INTERVAL;

struct timeval g_network_tv = {DEFAULT_NETWORK_TIMEOUT, 0};
struct event_base *g_event_base = NULL;

int g_allow_ip_count = 0;  /* -1 means match any ip address */
in_addr_t *g_allow_ip_addrs = NULL;  /* sorted array, asc order */

GroupArray g_group_array = {NULL, 0};

